<?xml version="1.0" encoding="utf-8" standalone="no"?>

<!--

	Open Financial Exchange Specification (c)1996-2003 ("Specification") by all of its publishers: 
	CheckFree Corp., Intuit Inc., and Microsoft Corporation. All rights reserved. 

	Revision History:

	Version	Date    	Editor Email Addr    		Short Description

	p18	2002-02-11  	altenburgd@businesslogic.com	Initial revision
        p21     2002-03-17      altenburgd@businesslogic.com    Changed elementFormDefault to "unqualified"
                                                                Changed namespace to "http://ofx.net/types/2003/04"
        p23    2002-05-13      altenburgd@businesslogic.com     Bugfixes based on Intuit Schema QA
		RC4    2002-06-24      gil_clark@intuit.com             Added collapse to int types.
	p24     2006-04-12 smithp@businesslogic.com              Added AccessKeyType
	                                                               MFAChallenge
	                                                               MFAPhraseLabelType
	                                                               MFAChallengeAnswer
	                                                               MFAChallengeAnswerContent
		2006-06-14	 wendy_dubois@intuit.com		more MFA changes 
-->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  elementFormDefault="unqualified"
  xmlns:ofx="http://ofx.net/types/2003/04"
  targetNamespace="http://ofx.net/types/2003/04">
  <xsd:include schemaLocation = "OFX_Common.xsd" /> 
 
  <xsd:complexType name="FinancialInstitution">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "FI" is of type "FinancialInstitution"
      </xsd:documentation>
    </xsd:annotation>

    <xsd:sequence>
      <xsd:element name="ORG" type="ofx:GenericNameType" />

      <xsd:element name="FID" type="ofx:FinancialInstitutionIdType" minOccurs="0"
      maxOccurs="1" />
    </xsd:sequence>
  </xsd:complexType>


  <xsd:simpleType name="ApplicationIdType">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "APPID" is of type "ApplicationIdType"
      </xsd:documentation>
    </xsd:annotation>

    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="5" />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="FinancialInstitutionCertificateIdType">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "FICERTID" is of type "FinancialInstitutionCertificateIdType"
      </xsd:documentation>
    </xsd:annotation>

    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="64" />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="IntegerType">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "INT" is of type "IntegerType"
      </xsd:documentation>
    </xsd:annotation>

    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="4"/>
      <xsd:pattern value="[0-9]+"/>
      <xsd:whiteSpace value="collapse"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="NumberNCEType">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "NONCE" is of type "NumberNCEType"
      </xsd:documentation>
    </xsd:annotation>

    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="16" />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="PasswordType">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "PASSWORD" is of type "PasswordType"
      </xsd:documentation>
    </xsd:annotation>

    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="171" />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="SessionCookieType">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "SESSCOOKIE" is of type "SessionCookieType"
      </xsd:documentation>
    </xsd:annotation>

    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="1000" />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="UserKeyType">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "USERKEY" is of type "UserKeyType"
      </xsd:documentation>
    </xsd:annotation>

    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="64" />
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="AccessKeyType">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "ACCESSKEY" is of type "AccessKeyType".
      </xsd:documentation>
    </xsd:annotation>

    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <!--
        Typical GUIDs (i.e. RFC 4122 ver 1 UUIDs) are 39 chars when you
        count the {}s.
      -->
      <xsd:maxLength value="1000"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:complexType name="MFAChallenge">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "MFACHALLENGE" is of type "MFAChallenge"
      </xsd:documentation>
    </xsd:annotation>

    <xsd:sequence>
      <xsd:element name="MFAPHRASEID" type="ofx:IdType"/>
      <xsd:element name="MFAPHRASELABEL" type="ofx:MFAPhraseType"
      minOccurs="0" maxOccurs="1"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="MFAChallengeAnswer">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "MFACHALLENGEANSWER" is of type "MFAChallengeAnswer".
      </xsd:documentation>
    </xsd:annotation>

    <xsd:sequence>
      <xsd:element name="MFAPHRASEID" type="ofx:IdType"/>
      <xsd:element name="MFAPHRASEA" type="ofx:MFAPhraseType"/>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:simpleType name="MFAPhraseType">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "MFAPHRASEA" is of type "MFAPhraseType".
        The OFX element "MFAPHRASELABEL" is of type "MFAPhraseType".
      </xsd:documentation>
    </xsd:annotation>
		<xsd:restriction base="xsd:string">
			<xsd:minLength value="1"/>
			<xsd:maxLength value="64"/>
		</xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="UserCredType">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "USERCRED1" is of type "UserCredType".
        The OFX element "USERCRED2" is of type "UserCredType".
        The effective size of USERCRED1 and USERCRED2 is A-32.  If Type 1
          security is used, then the actual field length is A-171.
      </xsd:documentation>
    </xsd:annotation>

    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="171"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="AuthTokenType">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "AUTHTOKEN" is of type "AuthTokenType".
        The effective size of AUTHTOKEN is A-32.  If Type 1
          security is used, then the actual field length is A-171.
      </xsd:documentation>
    </xsd:annotation>

    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="171"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:simpleType name="ClientUidType">
    <xsd:annotation>
      <xsd:documentation>
        The OFX element "CLIENTUID" is of type "ClientUidType"
      </xsd:documentation>
    </xsd:annotation>

    <xsd:restriction base="xsd:string">
      <xsd:minLength value="1"/>
      <xsd:maxLength value="36" />
    </xsd:restriction>
  </xsd:simpleType>

</xsd:schema>


